#include <iostream>

using namespace std;

typedef long long LL;
const int N = 110;
int n, q;
LL a[N];
LL f[N];

int main()
{
    cin >> n;
    for(int i = 1; i <= n; i++)
    {
        cin >> a[i];
        f[i] = f[i - 1] + a[i];
    }
    cin >> q;
    while(q--)
    {
        int l, r; cin >> l >> r;
        LL tmp = a[l];
        cout << tmp << " ";
        for(int i = l + 1; i <= r; i++)
        {
            cout << a[i] - a[i - 1] << " ";
        }
        cout << endl;
    }
    return 0;
}